import request from "../utils/request";

export const sendAudioAPI =(audioBlob)=>{
    const formData = new FormData();
    formData.append('file', audioBlob, 'recording.wav');
    return request({
        url:'/recognize',
        method:'post',
        data:formData,
        headers: {
            'Content-Type': 'multipart/form-data' // 上传文件时需要设置这个请求头
        }
    })
};

export const getChatAPI=(params)=>{
    return request({
        url:'/chat',
        method:'get',
        params:params
    })
}
